import { createRef, Component } from "react";

function App01() {
	const ref = createRef();
	const onClick = () => {
		console.log(ref);
		console.log(ref.current.value);
	};
	return (
		<div className="App">
			<div>这是第一种用法：直接挂载到dom</div>
			<input ref={ref} />
			<button onClick={onClick}>请点击 查看console</button>
		</div>
	);
}

export default App01;
